<template>
    <div>
        <Modal v-model="modalSs17002" :title=title width="1200" cancel-text="关闭" style="position:relative;"
               :mask-closable="false">
            <Spin v-if="Loading" size="large" fix></Spin>
            <Form ref="dataSs17002" :model="dataSs17002" :rules="ruleSs17002" inline :label-width="180"
                  :disabled=readonly>
                <table style="width:100%;">
                    <tr v-if="isSendedHd">
                        <td colspan="10">
                            <Alert type="error"><span style="color:#F00;">当前家庭已申请家庭经济状况核查，不允许编辑姓名、与申请人关系、证件号码、
                            户籍类别、与申请人关系、民族、婚姻状况、文化程度、健康状况、劳动能力丧失情况、身份证或户口簿等信息。</span></Alert>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:33%;" colspan="2">
                            <FormItem label="姓名" prop="azcp0003">
                                <c-blank-input v-model="dataSs17002.azcp0003" placeholder="请输入姓名" :disabled="isSendedHd||$parent.familyInfo.townshipEdit"
                                               class="itemStyle"
                                               :maxlength="30"/>
                            </FormItem>
                        </td>
                        <td style="width:33%;" colspan="2">
                            <FormItem label="与申请人关系" prop="azcp0517">
                                <Select v-model="dataSs17002.azcp0517" placeholder="" :disabled="isSendedHd"
                                        class="itemStyle">
                                    <Option v-for="item in relationList" :value="item.value" :key="item.value">{{
                                        item.label }}
                                    </Option>
                                </Select>
                            </FormItem>
                        </td>
                        <td rowspan="4" style="width:17%;">
                            <Upload action="" :accept="acceptImg"
                                    :before-upload="(file) => beforeUpload(file,'azcp0519')">
                                <img :src="dataSs17002.azcp0519" alt="..."
                                     style="height: 160px; width:120px;margin-left:50px;">
                            </Upload>
                        </td>
                        <td rowspan="4" style="width:17%;">
                            <div class="headerBtnDiv" @click="checkData()">
                                {{checkBtnName}}
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="证件类型" prop="azcp0002">
                                <dictSelect :sel_val='dataSs17002.azcp0002' :bindData.sync="dataSs17002.azcp0002"
                                            dictCode="certificatetype" showKeys="1" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="证件号码" prop="azcp0001">
                                <Input v-model="dataSs17002.azcp0001" placeholder="" class="itemStyle"
                                       :disabled="isSendedHd||$parent.familyInfo.townshipEdit" :readonly="dataSs17002.azcp0517=='01'"
                                       @on-blur="checkIdcard()"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="国籍" prop="azcp0006">
                                <dictSelect :sel_val='dataSs17002.azcp0006' :bindData.sync="dataSs17002.azcp0006"
                                            dictCode="nationality" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="户籍类别" prop="azcp0013">
                                <dictSelect :sel_val='dataSs17002.azcp0013' :bindData.sync="dataSs17002.azcp0013"
                                            :disabled="isSendedHd" dictCode="registertype" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="民族" prop="azcp0007">
                                <dictSelect :sel_val='dataSs17002.azcp0007' :bindData.sync="dataSs17002.azcp0007"
                                            :disabled="isSendedHd" dictCode="nation" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="文化程度" prop="azcp0008">
                                <dictSelect :sel_val='dataSs17002.azcp0008' :bindData.sync="dataSs17002.azcp0008"
                                            :disabled="isSendedHd" dictCode="education" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="政治面貌" prop="azcp0012">
                                <dictSelect :sel_val='dataSs17002.azcp0012' :bindData.sync="dataSs17002.azcp0012"
                                            dictCode="politicaloutlook" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="婚姻状况" prop="azcp0010">
                                <dictSelect :sel_val='dataSs17002.azcp0010' :bindData.sync="dataSs17002.azcp0010"
                                            :disabled="isSendedHd" dictCode="maritalstatus" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="特定救助对象类型" prop="azcp0547">
                                <dictSelect :sel_val='dataSs17002.azcp0547' :bindData.sync="dataSs17002.azcp0547"
                                            dictCode="specificrelief" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="学业状况" prop="azcp0539">
                                <dictSelect :sel_val='dataSs17002.azcp0539' :bindData.sync="dataSs17002.azcp0539"
                                            dictCode="educationstatus" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="就业状况" prop="azcp0540">
                                <dictSelect :sel_val='dataSs17002.azcp0540' :bindData.sync="dataSs17002.azcp0540"
                                            dictCode="workstatus" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="职业" prop="azcp0011">
                                <dictSelect :sel_val='dataSs17002.azcp0011' :bindData.sync="dataSs17002.azcp0011"
                                            dictCode="occupationtype" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="健康状况" prop="azcp0009">
                                <dictSelect :sel_val='dataSs17002.azcp0009' :bindData.sync="dataSs17002.azcp0009"
                                            :disabled="isSendedHd" dictCode="health" @changeState="setHealthState01"
                                            class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="劳动能力丧失情况" prop="azcp0502">
                                <dictSelect :sel_val='dataSs17002.azcp0502' :bindData.sync="dataSs17002.azcp0502"
                                            :disabled="isSendedHd" dictCode="workability" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否残疾" prop="azcp0503">
                                <dictSelect :sel_val='dataSs17002.azcp0503' :bindData.sync="dataSs17002.azcp0503"
                                            dictCode="yesorno" :disabled="azcp0503Disabled"
                                            @changeState="setDisabilityState01" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="残疾类别" prop="azcp0504" :rules="ruleAzcp0504">
                                <dictSelect :sel_val='dataSs17002.azcp0504' :bindData.sync="dataSs17002.azcp0504"
                                            dictCode="disabilitytype" :disabled="disabledCjr" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="残疾等级" prop="azcp0505" :rules="ruleAzcp0505">
                                <dictSelect :sel_val='dataSs17002.azcp0505' :bindData.sync="dataSs17002.azcp0505"
                                            dictCode="disabilityclass" :disabled="disabledCjr" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="残疾等级评定时间" prop="azcp0506">
                                <DatePicker type="date" v-model="dataSs17002.azcp0506" :disabled="disabilityState01"
                                            class="itemStyle" :editable="false" :clearable="true"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr v-if="multipleDisabilities">
                        <td colspan="2">
                            <FormItem label="视力残疾">
                                <dictSelect :sel_val='dataSs17002.azcp0595' :bindData.sync="dataSs17002.azcp0595"
                                            :disabled="multipleDisabilitiesEdit" :clearable="true"
                                            dictCode="disabilityclass" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="听力残疾">
                                <dictSelect :sel_val='dataSs17002.azcp0596' :bindData.sync="dataSs17002.azcp0596"
                                            :disabled="multipleDisabilitiesEdit" :clearable="true"
                                            dictCode="disabilityclass" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="言语残疾">
                                <dictSelect :sel_val='dataSs17002.azcp0597' :bindData.sync="dataSs17002.azcp0597"
                                            :disabled="multipleDisabilitiesEdit" :clearable="true"
                                            dictCode="disabilityclass" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr v-if="multipleDisabilities">
                        <td colspan="2">
                            <FormItem label="肢体残疾">
                                <dictSelect :sel_val='dataSs17002.azcp0598' :bindData.sync="dataSs17002.azcp0598"
                                            :disabled="multipleDisabilitiesEdit" :clearable="true"
                                            dictCode="disabilityclass" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="智力残疾">
                                <dictSelect :sel_val='dataSs17002.azcp0599' :bindData.sync="dataSs17002.azcp0599"
                                            :disabled="multipleDisabilitiesEdit" :clearable="true"
                                            dictCode="disabilityclass" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="精神残疾">
                                <dictSelect :sel_val='dataSs17002.azcp0600' :bindData.sync="dataSs17002.azcp0600"
                                            :disabled="multipleDisabilitiesEdit" :clearable="true"
                                            dictCode="disabilityclass" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="重病名称" prop="azcp0525" :rules="ruleAzcp0525">
                                <Input v-model="dataSs17002.azcp0525" placeholder="" :disabled="healthState01"
                                       maxlength="30"
                                       class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="重病病种" prop="azcp0524" :rules="ruleAzcp0524">
                                <dictSelect :sel_val='dataSs17002.azcp0524' :bindData.sync="dataSs17002.azcp0524"
                                            dictCode="sicknesstype" :disabled="healthState01" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="重病患病时间" prop="azcp0522">
                                <DatePicker type="date" v-model="dataSs17002.azcp0522" style="width: 178px"
                                            :disabled="healthState01" class="itemStyle" :editable="false" :clearable="true"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="是否伤残" prop="azcp0507">
                                <dictSelect :sel_val='dataSs17002.azcp0507' :bindData.sync="dataSs17002.azcp0507"
                                            dictCode="yesorno" @changeState="setMaimState" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="伤残等级" prop="azcp0508" :rules="ruleAzcp0508">
                                <dictSelect :sel_val='dataSs17002.azcp0508' :bindData.sync="dataSs17002.azcp0508"
                                            dictCode="invalidismclass" :disabled="maimState" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="伤残等级评定时间" prop="azcp0509">
                                <DatePicker type="date" v-model="dataSs17002.azcp0509" style="width: 178px"
                                            :disabled="maimState" class="itemStyle" :editable="false" :clearable="true"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="生活自理能力" prop="azcp0513">
                                <dictSelect :sel_val='dataSs17002.azcp0513' :bindData.sync="dataSs17002.azcp0513"
                                            dictCode="selfcareability" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="护理类型" prop="azcp0546">
                                <dictSelect :sel_val='dataSs17002.azcp0546' :bindData.sync="dataSs17002.azcp0546"
                                            :disabled="healthState01"
                                            dictCode="nursetype" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="优抚对象类别" prop="azcp0520">
                                <dictSelect :sel_val='dataSs17002.azcp0520' :bindData.sync="dataSs17002.azcp0520"
                                            dictCode="specialcare" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="是否军休干部" prop="azcp0018">
                                <dictSelect :sel_val='dataSs17002.azcp0018' :bindData.sync="dataSs17002.azcp0018"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否收养对象" prop="azcp0023">
                                <dictSelect :sel_val='dataSs17002.azcp0023' :bindData.sync="dataSs17002.azcp0023"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否流浪乞讨救助人员" prop="azcp0024">
                                <dictSelect :sel_val='dataSs17002.azcp0024' :bindData.sync="dataSs17002.azcp0024"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="是否三无人员" prop="azcp0512">
                                <dictSelect :sel_val='dataSs17002.azcp0512' :bindData.sync="dataSs17002.azcp0512"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否福利院入住对象" prop="azcp0025">
                                <dictSelect :sel_val='dataSs17002.azcp0025' :bindData.sync="dataSs17002.azcp0025"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否复原退伍军人" prop="azcp0027">
                                <dictSelect :sel_val='dataSs17002.azcp0027' :bindData.sync="dataSs17002.azcp0027"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="现居住地开始居住时间" prop="azcp0501">
                                <DatePicker v-model="dataSs17002.azcp0501" type="date" class="itemStyle" :editable="false" :clearable="true"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="联系电话" prop="azcp0514">
                                <Input v-model="dataSs17002.azcp0514" placeholder="" class="itemStyle" maxlength="20"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="养老保险参保类型" prop="azcp0526">
                                <dictSelect :sel_val='dataSs17002.azcp0526' :bindData.sync="dataSs17002.azcp0526"
                                            dictCode="pensiontype" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="当前是否已参加医疗保险" prop="azcp0527">
                                <dictSelect :sel_val='dataSs17002.azcp0527' :bindData.sync="dataSs17002.azcp0527"
                                            dictCode="insuranceornot" @changeState="setMedicalInsuranceState"
                                            class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="医疗保险参保类型" prop="azcp0528" :rules="ruleAzcp0528">
                                <dictSelect :sel_val='dataSs17002.azcp0528' :bindData.sync="dataSs17002.azcp0528"
                                            dictCode="insuredtype" :disabled="medicalInsuranceState" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否参加失业保险" prop="azcp0531">
                                <dictSelect :sel_val='dataSs17002.azcp0531' :bindData.sync="dataSs17002.azcp0531"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="社保编号或新农合编号" prop="azcp0529">
                                <Input v-model="dataSs17002.azcp0529" placeholder="" class="itemStyle" maxlength="20"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="社保卡号或新农合卡号" prop="azcp0530">
                                <Input v-model="dataSs17002.azcp0530" placeholder="" class="itemStyle" maxlength="20"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="所属资源枯竭关破企业名称" prop="azcp0541">
                                <dictSelect :sel_val='dataSs17002.azcp0541' :bindData.sync="dataSs17002.azcp0541"
                                            dictCode="brokenenterprise" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FormItem label="是否纳入扶贫建档立卡对象" prop="azcp0545">
                                <dictSelect :sel_val='dataSs17002.azcp0545' :bindData.sync="dataSs17002.azcp0545"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否法人代表" prop="azcp0579">
                                <dictSelect :disabled=true :sel_val='dataSs17002.azcp0579'
                                            :bindData.sync="dataSs17002.azcp0579"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="企业或社会组织名称" prop="azcp0580">
                                <Input :disabled=true v-model="dataSs17002.azcp0580" placeholder="" class="itemStyle"
                                       maxlength="50"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <!--                        <td colspan="2">-->
                        <!--                            <FormItem label="企业或社会组织地址" prop="azcp0580">-->
                        <!--                                <Input v-model="dataSs17002.azcp0580" placeholder="" class="itemStyle"/>-->
                        <!--                            </FormItem>-->
                        <!--                        </td>-->
                        <!--                        <td colspan="2">-->
                        <!--                            <FormItem label="注册资金(万元)" prop="azcp0582">-->
                        <!--                                <Input v-model="dataSs17002.azcp0582" placeholder="" class="itemStyle"/>-->
                        <!--                            </FormItem>-->
                        <!--                        </td>-->
                        <td colspan="2">
                            <FormItem label="单亲丧偶(失踪、服刑)" prop="azcp0585">
                                <dictSelect :sel_val='dataSs17002.azcp0585' :bindData.sync="dataSs17002.azcp0585"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="刑满释放人员" prop="azcp0586">
                                <dictSelect :sel_val='dataSs17002.azcp0586' :bindData.sync="dataSs17002.azcp0586"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2">
                            <FormItem label="是否扶贫人口" prop="azcp0587">
                                <dictSelect :disabled=true :sel_val='dataSs17002.azcp0587'
                                            :bindData.sync="dataSs17002.azcp0587"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <!--                    户籍区划功能-->
                        <td colspan="4">
                            <FormItem label="户籍地址" prop="azcp0603">
                                <Ss01003Tag :bindshengjiData.sync="dataSs17002.azcp0602"
                                            :bindshijiData.sync="dataSs17002.azcp0603"
                                            :shengji_value="dataSs17002.azcp0602"
                                            :shiji_value="dataSs17002.azcp0603"
                                            :shengji_disabled="hujiquhuaDisabled"
                                            :shiji_disabled="hujiquhuaDisabled">
                                </Ss01003Tag>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" v-if="!azcp0583Disabled">
                            <FormItem label="单人保类型" prop="azcp0583" :rules="ruleAzcp0583">
                                <dictSelect :sel_val='dataSs17002.azcp0583' :disabled="azcp0583Disabled"
                                            :bindData.sync="dataSs17002.azcp0583"
                                            dictCode="alonetype" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2" v-if="!azcp0583Disabled">
                            <Button type="text" size="small" @click="showSingleRule">办理细则查看</Button>
                        </td>
                        <td colspan="2" v-if="!azcp0584Disabled">
                            <FormItem label="建档立卡类型" prop="azcp0584" :rules="ruleAzcp0584">
                                <dictSelect :disabled="azcp0584Disabled" :sel_val='dataSs17002.azcp0584'
                                            :bindData.sync="dataSs17002.azcp0584"
                                            dictCode="filing_type" class="itemStyle"/>
                            </FormItem>
                        </td>
                        <td colspan="2" v-if="!azcp0584Disabled">
                            <Button type="text" size="small" @click="showPoorRule">办理细则查看</Button>
                        </td>
                        <td colspan="2" hidden>
                            <FormItem label="是否本地户籍" prop="azcp0591">
                                <dictSelect :disabled=true :sel_val='dataSs17002.azcp0591'
                                            :bindData.sync="dataSs17002.azcp0591"
                                            dictCode="yesorno" class="itemStyle"/>
                            </FormItem>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <FormItem label="证件上传类型">
                                <RadioGroup v-model="dataSs17002.azcp0593" type="button" @on-change="showUpload">
                                    <Radio label="0">身份证正反面照片上传</Radio>
                                    <Radio label="1" :disabled="householdRegisterState">户口簿个人页照片上传</Radio>
                                </RadioGroup>
                            </FormItem>
                        </td>
                        <td colspan="2">
                        </td>
                    </tr>
                </table>
                <Row class="" style="height:250px;line-height:150px;margin-top: 10px" >
                    <Col span="24" style="text-align: center" class="">
                        <Row v-if="identityCardVisible">
                            <Col span="12" class="">
                                <Upload action="" :accept="acceptImg" :disabled="isSendedHd"
                                        :before-upload="(file) => beforeUpload(file,'azcp0551')">
                                    <Row class="imgBackColor">
                                        <i-col span="20" class="idCard">
                                            <img :src="dataSs17002.azcp0551" class="head-img1">
                                        </i-col>
                                        <i-col span="4" class="positiveTDiv">正面上传</i-col>
                                    </Row>
                                </Upload>
                            </Col>
                            <Col span="12" style="text-align: center" class="">
                                <Upload action="" :accept="acceptImg" :disabled="isSendedHd"
                                        :before-upload="(file) => beforeUpload(file,'azcp0552')">
                                    <Row class="imgBackColor">
                                        <i-col span="20" class="idCard">
                                            <img :src="dataSs17002.azcp0552" class="head-img1">
                                        </i-col>
                                        <i-col span="4" class="positiveTDiv">反面上传</i-col>
                                    </Row>
                                </Upload>
                            </Col>
                        </Row>
                        <Row v-if="householdRegisterVisible">
                            <Col span="12" style="text-align: center" class="">
                                <Upload action="" :accept="acceptImg" :disabled="isSendedHd"
                                        :before-upload="(file) => beforeUpload(file,'azcp0594')">
                                    <Row class="imgBackColor">
                                        <i-col span="20" class="idCard">
                                            <img :src="dataSs17002.azcp0594" class="head-img1">
                                        </i-col>
                                        <i-col span="4" class="positiveTDiv">户口簿上传</i-col>
                                    </Row>
                                </Upload>
                            </Col>
                            <Col span="12" style="text-align: center" class="">
                            </Col>
                        </Row>
                    </Col>
                </Row>
            </Form>
            <div slot="footer">
                <Button type="text" size="large" @click="modalSs17002 = false">取消</Button>
                <Button type="primary" size="large" @click="handleSubmitSs17002('dataSs17002')"
                        :disabled="validateStatus" v-if=!readonly>确定
                </Button>
            </div>
        </Modal>

        <Modal v-model="ss00011ModelShow" style="margin-top:20px;" :title="yzModalTitle" :mask-closable="false"
               width="800">
            <Ss00011Check
                    :azcp0001="dataSs17002.azcp0001"
                    :azcp0003="dataSs17002.azcp0003"
                    :ssca0002="$parent.familyInfo.ssca0002"
                    :ssca0016="$parent.familyInfo.ssca0016"
                    :ss12001Id="dataSs17002.ss12001Id"
                    :ss17001Id="dataSs17002.azcp0500"
                    :ss17002Id="dataSs17002.id"
                    :isRequestBackstage="ss00011ModelShow"
                    :batchNumber.sync="batchNumber"
                    :validateInfo.sync="validateInfo"
                    :validateStatus.sync="validateStatus"
                    :azcp0503.sync="dataSs17002.azcp0503"
                    :azcp0504.sync="dataSs17002.azcp0504"
                    :azcp0505.sync="dataSs17002.azcp0505"
                    :azcp0579.sync="dataSs17002.azcp0579"
                    :azcp0580.sync="dataSs17002.azcp0580"
                    :azcp0587.sync="dataSs17002.azcp0587"
                    :azcp0591.sync="dataSs17002.azcp0591"
                    :azcp0595.sync="dataSs17002.azcp0595"
                    :azcp0596.sync="dataSs17002.azcp0596"
                    :azcp0597.sync="dataSs17002.azcp0597"
                    :azcp0598.sync="dataSs17002.azcp0598"
                    :azcp0599.sync="dataSs17002.azcp0599"
                    :azcp0600.sync="dataSs17002.azcp0600"
            />
        </Modal>
        <poorRuleModal ref="poorRuleModal"></poorRuleModal>
        <singleRuleModal ref="singleRuleModal"></singleRuleModal>

    </div>
</template>

<script>
  import dictSelect from '@/components/dictSelect/dictSelect.vue'
  import pic_hkb from '@/assets/images/hkb.jpg'
  import pic_sfz_z from '@/assets/images/sfz_z.jpg'
  import pic_sfz_f from '@/assets/images/sfz_f.jpg'
  import pic_header from '@/assets/images/header.jpeg'
  import { getAction, postAction } from '@/api/request'
  import { IdentityCodeValid, getAgeByIdcardByHD } from '@/plugins/idcardValid.js'
  import Ss00011Check from '@/components/system/ss00011-check'
  import poorRuleModal from '../../ss11_create_steps/modules/PoorRuleModal.vue'
  import singleRuleModal from '../../ss11_create_steps/modules/SingleRuleModal.vue'
  import Ss01003Tag from '@/components/system/ss01003-select'// 户籍区划功能
  import { CommonMixin } from '@/views/common/js/CommonMixin'

  export default {
    mixins: [CommonMixin],
    components: {
      dictSelect,
      Ss00011Check,
      poorRuleModal,
      singleRuleModal,
      Ss01003Tag //户籍区划功能
    },
    data () {
      return {
        azcp0503Disabled: false,
        multipleDisabilities: false,  //是否多重残疾
        multipleDisabilitiesEdit: false,
        hujiquhuaDisabled: false, //户籍区划功能
        upLoading: false,
        isSendedHd: false,
        disabledCjr: true,
        readonly: false,
        householdRegisterState: true, //户口簿是否可上传，默认false
        url: {
          insertSs17002: '/api/ac/subsistence/ss17002Service/createData',
          updateSs17002: '/api/ac/subsistence/ss17002Service/updateData',
        },
        identityCardVisible: true,
        householdRegisterVisible: false,
        title: '',
        dataSs17002: {
          type: '1', // 保障人员类型
          id: '',
          azcp0507: '',
          ss12001Id: '',
          azcp0503: '',
          azcp0505: '',
          azcp0504: '',
          azcp0502: '',
          azcp0543: '',
          azcp0027: '',
          azcp0024: '',
          azcp0541: '',
          azcp0025: '',
          azcp0547: '',
          azcp0545: '',
          azcp0023: '',
          azcp0540: '',
          azcp0539: '',
          azcp0013: '',
          azcp0530: '',
          azcp0531: '',
          azcp0018: '',
          azcp0011: '',
          azcp0012: '',
          azcp0010: '',
          azcp0529: '',
          azcp0527: '0',
          azcp0002: '',
          azcp0003: '',
          azcp0520: '',
          azcp0008: '',
          azcp0525: '',
          azcp0009: '',
          azcp0526: '',
          azcp0006: '',
          azcp0007: '',
          azcp0524: '',
          azcp0001: '',
          azcp0517: '',
          azcp0514: '',
          azcp0512: '',
          azcp0513: '',
          azcp0020: '',
          azcp0510: '',
          azcp0518: '',
          azcp0519: '',
          azcp0523: '',
          azcp0508: '',
          azcp0579: '',
          azcp0581: '',
          azcp0580: '',
          azcp0582: '',
          azcp0585: '',
          azcp0584: '',
          azcp0586: '',
          azcp0583: '',
          azcp0591: '',
          azcp0551: '',
          azcp0552: '',
          azcp0593: '',
          azcp0594: '',
          azcp0578: '0',
          azcp0500: '',
          azcp0528: null,
          azcp0546: null,
          azcp0602: '',
          azcp0603: '',
          azcp0509: null,
          azcp0522: null,
          azcp0501: null,
          azcp0506: null
        },
        relationList: [], //保障人员家庭关系
        modalSs17002: false, //保障人员model显隐
        healthState01: false,  //保障人员健康状况联动状态
        disabilityState01: false, //保障人员残疾联动状态
        maimState: false,  //伤残联动状态
        medicalInsuranceState: true, //医保联动状态
        azcp0583Disabled: true, //单人保类型
        azcp0584Disabled: true, //农村建档立卡类型
        fieldsToValidate01: ['azcp0003', 'azcp0517', 'azcp0002', 'azcp0001', 'azcp0013', 'azcp0007', 'azcp0008', 'azcp0012', 'azcp0010',
          'azcp0540', 'azcp0009', 'azcp0502', 'azcp0503', 'azcp0504', 'azcp0505', 'azcp0525', 'azcp0524', 'azcp0508', 'azcp0513', 'azcp0512',
          'azcp0526', 'azcp0527', 'azcp0528', 'azcp0531', 'azcp0586', 'azcp0583', 'azcp0584','azcp0603'],
        ruleSs17002: {
          azcp0003: [
            { required: true, message: '请输入姓名', trigger: 'blur' }
          ],
          azcp0517: [
            { required: true, message: '请选择与申请人关系', trigger: 'blur' }
          ],
          azcp0002: [
            { required: true, message: '请选择证件类型', trigger: 'blur' }
          ],
          azcp0001: [
            { required: true, message: '请填写证件号码', trigger: 'blur' }
          ],
          azcp0013: [
            { required: true, message: '请选择户籍类别', trigger: 'blur' }
          ],
          azcp0007: [
            { required: true, message: '请选择民族', trigger: 'blur' }
          ],
          azcp0008: [
            { required: true, message: '请选择文化程度', trigger: 'blur' }
          ],
          azcp0012: [
            { required: true, message: '请选择政治面貌', trigger: 'blur' }
          ],
          azcp0010: [
            { required: true, message: '请选择婚姻状况', trigger: 'blur' }
          ],
          azcp0540: [
            { required: true, message: '请选择就业状况', trigger: 'blur' }
          ],
          azcp0009: [
            { required: true, message: '请选择健康状况', trigger: 'blur' }
          ],
          azcp0502: [
            { required: true, message: '请选择劳动能力丧失情况', trigger: 'blur' }
          ],
          azcp0503: [
            { required: true, message: '请选择是否残疾', trigger: 'blur' }
          ],
          azcp0513: [
            { required: true, message: '请选择生活自理能力', trigger: 'blur' }
          ],
          azcp0512: [
            { required: true, message: '请选择是否三无人员', trigger: 'blur' }
          ],
          azcp0526: [
            { required: true, message: '请选择养老保险参保类型', trigger: 'blur' }
          ],
          azcp0527: [
            { required: true, message: '请选择当前是否已参加医疗保险', trigger: 'blur' }
          ],
          azcp0531: [
            { required: true, message: '请选择是否参加失业保险', trigger: 'blur' }
          ],
          azcp0586: [
            { required: true, message: '请选择是否刑满释放人员', trigger: 'blur' }
          ],
          azcp0603: [
            { required: true, message: '请选择户籍地址', trigger: 'blur' }
          ]
        },
        ruleAzcp0583: { message: '请选择单人保类型', trigger: 'blur' },
        ruleAzcp0584: { message: '请选择建档立卡类型', trigger: 'blur' },
        ruleAzcp0504: { message: '请选择残疾类别', trigger: 'blur' },
        ruleAzcp0505: { message: '请选择残疾等级', trigger: 'blur' },
        ruleAzcp0524: { message: '请选择重病病种', trigger: 'blur' },
        ruleAzcp0525: { message: '请填写重病名称', trigger: 'blur' },
        ruleAzcp0508: { message: '请选择伤残等级', trigger: 'blur' },
        ruleAzcp0528: { message: '请选择医疗保险类型', trigger: 'blur' },
        checkBtnName: '未查验',
        validateStatus: true, //查验状态 true 未查验或查验异常 false 查验通过
        //批次号
        batchNumber: '',
        validateInfo: '',
        //事前查验标题
        yzModalTitle: '',
        ss00011ModelShow: false,
        Loading: false,
      }
    },
    methods: {
      showUpload (type) { //处理证件上传类型
        //已发送核对或详情状态不触发事件
        if (this.isSendedHd || this.readonly) {
          return
        }
        let that = this
        if (type == '0') {
          that.identityCardVisible = true
          that.householdRegisterVisible = false
          that.dataSs17002.azcp0593 = '0'
          let azcp0551 = that.dataSs17002.azcp0551
          if (this.isEmpty(azcp0551)) {
            that.dataSs17002.azcp0551 = pic_sfz_z
          }
          let azcp0552 = that.dataSs17002.azcp0552
          if (this.isEmpty(azcp0552)) {
            that.dataSs17002.azcp0552 = pic_sfz_f
          }
        } else {
          that.identityCardVisible = false
          that.householdRegisterVisible = true
          that.dataSs17002.azcp0593 = '1'
          let azcp0594 = that.dataSs17002.azcp0594
          if (this.isEmpty(azcp0594)) {
            that.dataSs17002.azcp0594 = pic_hkb
          }
        }
      },
      create () {
        let that = this
        that.readonly = false
        that.clearPropertyValue(that.dataSs17002);
        that.title = '保障家庭成员录入';
        that.checkBtnName="未查验";
        that.validateStatus = true;
        that.modalSs17002 = true
        that.initRelation01()
        that.handleRelationship('member')
        that.dataSs17002.azcp0519 = pic_header
        that.dataSs17002.azcp0551 = pic_sfz_z
        that.dataSs17002.azcp0552 = pic_sfz_f
        that.dataSs17002.azcp0594 = pic_hkb
        that.dataSs17002.azcp0500 = that.ss17001Id
        that.dataSs17002.ss12001Id = that.ss12001Id
        //单人保
        let ssca0002=that.$parent.familyInfo.ssca0002;
        if (ssca0002 == '101' || ssca0002 == '201') {
          that.azcp0583Disabled = false
          that.ruleAzcp0583 = [{ required: true, message: '请选择单人保类型', trigger: 'blur' }]
          that.ruleSs17002.azcp0583 = that.ruleAzcp0583
        } else {
          that.azcp0583Disabled = true
          that.ruleAzcp0583 = [{ required: false }]
          that.dataSs17002.azcp0583 = ''
          delete that.ruleSs17002.azcp0583
        }
        //农村建档立卡
        if (ssca0002 == '203' ) {
          that.azcp0584Disabled = false
          that.ruleAzcp0584 = [{ required: true, message: '请选择建档立卡类型', trigger: 'blur' }]
          that.ruleSs17002.azcp0584 = that.ruleAzcp0584
        } else {
          that.azcp0584Disabled = true
          that.ruleAzcp0584 = [{ required: false }]
          that.dataSs17002.azcp0584 = ''
          delete that.ruleSs17002.azcp0584
        }
        that.householdRegisterState = true
        that.shengShiQuHua(undefined) //户籍区划功能
      },

      async load (url, dataParam, familyInfo) {
        this.Loading = true
        this.readonly = false
        this.title = '保障家庭成员编辑'
        this.modalSs17002 = true
        var that = this
        postAction(url, dataParam).then((res) => {
          if (res.data.data.code == 1) {
            res.data.data.data.ss12001Id = familyInfo.ss12001Id
            res.data.data.data.ssca0016 = familyInfo.ssca0016//操作类型 213 城保转城保单人保
            that.edit(res.data.data.data)
            // that.shengShiQuHua(that.dataSs17002.azcp0591); //户籍区划功能
          } else {
            that.$Message.error(res.data.data.msg)
          }
        }).finally(() => {
          this.Loading = false
        })
      },

      async edit (record) {
        let that = this
        that.dataSs17002 = {}
        that.validateStatus = true
        if (record.azcp0517 == '01') {
          await that.handleRelationship('master')
        } else {
          await that.handleRelationship('member')
        }
        that.dataSs17002 = Object.assign({}, record)
        if(that.dataSs17002.azcp0509){
          that.dataSs17002.azcp0509 = new Date(record.azcp0509)
        }
        if(that.dataSs17002.azcp0522){
          that.dataSs17002.azcp0522 = new Date(record.azcp0522)
        }
        if(that.dataSs17002.azcp0501){
          that.dataSs17002.azcp0501 = new Date(record.azcp0501)
        }
        if(that.dataSs17002.azcp0506){
          that.dataSs17002.azcp0506 = new Date(record.azcp0506)
        }
        that.initRelation01()

        if (that.dataSs17002.azcp0593 == '1') {
          let azcp0594 = that.dataSs17002.azcp0594
          if (this.isEmpty(azcp0594)) {
            that.dataSs17002.azcp0594 = pic_hkb
          }
        } else {
          let azcp0551 = that.dataSs17002.azcp0551
          if (this.isEmpty(azcp0551)) {
            that.dataSs17002.azcp0551 = pic_sfz_z
          }
          let azcp0552 = that.dataSs17002.azcp0552
          if (this.isEmpty(azcp0552)) {
            that.dataSs17002.azcp0552 = pic_sfz_f
          }
        }
        let azcp0519 = that.dataSs17002.azcp0519
        if (this.isEmpty(azcp0519)) {
          that.dataSs17002.azcp0519 = pic_header
        }
        that.showUpload(that.dataSs17002.azcp0593)
        that.checkIdcard()
        that.setCheckStatus(that.dataSs17002.azcp0578)
        //单人保
        let ssca0002=that.$parent.familyInfo.ssca0002;
        if (ssca0002 == '101' || ssca0002 == '201') {
          that.azcp0583Disabled = false
          that.ruleAzcp0583 = [{ required: true, message: '请选择单人保类型', trigger: 'blur' }]
          that.ruleSs17002.azcp0583 = that.ruleAzcp0583
        } else {
          that.azcp0583Disabled = true
          that.ruleAzcp0583 = [{ required: false }]
          that.dataSs17002.azcp0583 = ''
          delete that.ruleSs17002.azcp0583
        }
        //农村建档立卡
        if (ssca0002 == '203') {
          that.azcp0584Disabled = false
          that.ruleAzcp0584 = [{ required: true, message: '请选择建档立卡类型', trigger: 'blur' }]
          that.ruleSs17002.azcp0584 = that.ruleAzcp0584
        } else {
          that.azcp0584Disabled = true
          that.ruleAzcp0584 = [{ required: false }]
          that.dataSs17002.azcp0584 = ''
          delete that.ruleSs17002.azcp0584
        }
        //已申请家庭经济状况核查
        that.isSendedHd = that.$parent.familyInfo.isSendedHd
        that.hujiquhuaDisabled = that.$parent.familyInfo.isSendedHd
        that.shengShiQuHua(that.dataSs17002.azcp0591) //户籍区划功能
      },
      async view (record) {
        let that = this
        that.validateStatus = true
        that.readonly = true
        that.title = '保障家庭成员详情'
        if (record.azcp0517 == '01') {
          await that.handleRelationship('master')
        } else {
          await that.handleRelationship('member')
        }
        that.modalSs17002 = true
        that.edit(record)
      },
      handleSubmitSs17002 (name) { // 保障人员信息提交
        let that = this
        let validate = true
        let err_msg = []
        for (let item of this.fieldsToValidate01) {
          if (that.azcp0583Disabled && item == 'azcp0583') {
            continue
          }
          if (that.azcp0584Disabled && item == 'azcp0584') {
            continue
          }
          this.$refs[name].validateField(item, (error) => {
            if (error) {
              validate = false
              err_msg.push(this.ruleSs17002[item][0].message)
            }
          })
        }
        console.log('ss17002model',that.dataSs17002);
        if (validate) {
          let dataParam = {}
          // 户籍验证功能
          dataParam = Object.assign({}, that.dataSs17002)
          dataParam.AssistanceType = '200'
          let url = null
          if (that.isEmpty(dataParam.id)) {
            url = that.url.insertSs17002
          } else {
            url = that.url.updateSs17002
          }
          if (dataParam.azcp0593 == '1') {
            let azcp0594 = dataParam.azcp0594
            if (that.isEmpty(azcp0594) || azcp0594 == pic_hkb) {
              that.$Message.error('请上传个人户口簿页面照片')
              return
            }
            dataParam.azcp0551 = ''
            dataParam.azcp0552 = ''
          } else {
            let azcp0551 = dataParam.azcp0551
            if (that.isEmpty(azcp0551) || azcp0551 == pic_sfz_z) {
              that.$Message.error('请上传居民身份证正面照片')
              return
            }

            let azcp0552 = dataParam.azcp0552
            if (that.isEmpty(azcp0552) || azcp0552 == pic_sfz_f) {
              that.$Message.error('请上传居民身份证反面照片')
              return
            }
            dataParam.azcp0594 = ''
          }
          if (that.validateStatus == true) {
            that.$Message.error('人员信息未查验!')
            return
          }
          if (dataParam.azcp0504 === '67') {
            let selectedNum = 0
            if (dataParam.azcp0595 != '' && dataParam.azcp0595 != undefined) {
              selectedNum += 1
            }
            if (dataParam.azcp0596 != '' && dataParam.azcp0596 != undefined) {
              selectedNum += 1
            }
            if (dataParam.azcp0597 != '' && dataParam.azcp0597 != undefined) {
              selectedNum += 1
            }
            if (dataParam.azcp0598 != '' && dataParam.azcp0598 != undefined) {
              selectedNum += 1
            }
            if (dataParam.azcp0599 != '' && dataParam.azcp0599 != undefined) {
              selectedNum += 1
            }
            if (dataParam.azcp0600 != '' && dataParam.azcp0600 != undefined) {
              selectedNum += 1
            }
            if (selectedNum < 2) {
              that.$Message.error('多重残疾, 需要选择两种残疾类型')
              return
            }
          }
          if(dataParam.azcp0519==pic_header){
            dataParam.azcp0519=null;
          }
          that.Loading = true
          dataParam.azcp0500 = that.$parent.familyInfo.ss17001Id
          postAction(url, dataParam).then((res) => {
            if (res.data.data) {
              if (res.data.data.code == 1) {
                that.modalSs17002 = false
                that.$Message.success(res.data.data.msg)
                that.$emit('ok')
              } else {
                that.$Message.error(res.data.data.msg)
              }
            } else {
              that.$Message.error(res.data.errmsg)
            }

          }).finally(() => {
            that.Loading = false
          })
        } else {
          that.$Message.error(err_msg[0])
          return
        }
      },
      initRelation01 () { //初始化保障人员页面选择联动
        let that = this
        that.setDisabilityState01()
        that.setMaimState()
        that.setHealthState01()
        that.setMedicalInsuranceState()
      },
      setDisabilityState01 () { //残疾联动
        let that = this
        let value = that.dataSs17002.azcp0503
        if (value == '1') {
          that.disabilityState01 = false
          that.ruleAzcp0504 = [{ required: true, message: '请选择残疾类别', trigger: 'blur' }]
          that.ruleAzcp0505 = [{ required: true, message: '请选择残疾等级', trigger: 'blur' }]
          that.ruleSs17002.azcp0504 = that.ruleAzcp0504
          that.ruleSs17002.azcp0505 = that.ruleAzcp0505
          // that.disabledCjr = false;
          if (that.dataSs17002.azcp0591 == '1') { //同时满足本市户籍且为残疾的, 残疾等级与类别不可选
            that.disabledCjr = true
          } else {
            that.disabledCjr = false
          }
        } else {
          that.ruleAzcp0504 = [{ required: false }]
          that.ruleAzcp0505 = [{ required: false }]
          this.$set(this.dataSs17002, 'azcp0504', '')
          this.$set(this.dataSs17002, 'azcp0505', '')
          this.$set(this.dataSs17002, 'azcp0506', null)
          that.disabilityState01 = true
          delete that.ruleSs17002.azcp0504
          delete that.ruleSs17002.azcp0505
          that.disabledCjr = true
        }
      },
      setHealthState01 () {  //健康联动
        let that = this
        let value = that.dataSs17002.azcp0009
        if (value == '40') {  //重病
          that.healthState01 = false
          that.ruleAzcp0525 = [{ required: true, message: '请填写重病名称', trigger: 'blur' }]
          that.ruleAzcp0524 = [{ required: true, message: '请选择重病病种', trigger: 'blur' }]
          that.ruleSs17002.azcp0525 = that.ruleAzcp0525
          that.ruleSs17002.azcp0524 = that.ruleAzcp0524
        } else { //健康、一般、慢性病
          that.ruleAzcp0525 = [{ required: false }]
          that.ruleAzcp0524 = [{ required: false }]
          this.$set(this.dataSs17002, 'azcp0524', '')
          this.$set(this.dataSs17002, 'azcp0546', '')
          this.$set(this.dataSs17002, 'azcp0525', '')
          this.$set(this.dataSs17002, 'azcp0522', null)
          that.healthState01 = true
          delete that.ruleSs17002.azcp0525
          delete that.ruleSs17002.azcp0524
        }
      },
      setMaimState () { //伤残联动
        let that = this
        let value = that.dataSs17002.azcp0507
        if (value == '1') {
          that.maimState = false
          that.ruleAzcp0508 = [{ required: true, message: '请选择伤残等级', trigger: 'blur' }]
          that.ruleSs17002.azcp0508 = that.ruleAzcp0508
        } else {
          that.ruleAzcp0508 = [{ required: false }]
          this.$set(this.dataSs17002, 'azcp0508', '')
          this.$set(this.dataSs17002, 'azcp0509', null)
          that.maimState = true
          delete that.ruleSs17002.azcp0508
        }
      },
      setMedicalInsuranceState () {  //医保联动
        let that = this
        let value = that.dataSs17002.azcp0527
        if (value == '1') {
          that.medicalInsuranceState = false
          that.ruleAzcp0528 = [{ required: true, message: '请选择医疗保险类型', trigger: 'blur' }]
          that.ruleSs17002.azcp0528 = that.ruleAzcp0528
        } else {
          that.ruleAzcp0528 = [{ required: false }]
          this.$set(this.dataSs17002, 'azcp0528', '')
          that.medicalInsuranceState = true
          delete that.ruleSs17002.azcp0528
        }
      },
      async handleRelationship (type) {
        let that = this
        let param = {}
        param.pageNo = 1// 当前页数
        param.pageSize = 999//每页显示条数
        param.type = 'familyrelationship' //字典type值
        await postAction('/api/as/sc/dict/getDictList', param).then((res) => {
          if (res.data.errcode === 0) {
            if (type == 'master') {
              let arr = res.data.data.results
              for (let j = 0; j < arr.length; j++) {
                let item = arr[j]
                if (item.value != '01') {
                  arr.splice(j--, 1)
                }
              }
              that.relationList = arr
            } else {
              let arr = res.data.data.results
              for (let j = 0; j < arr.length; j++) {
                let item = arr[j]
                if (!that.readonly) { //非只读模式过滤掉旧版家庭关系字典
                  if (item.value == '01' || item.value == '10' || item.value == '20' || item.value == '30' || item.value == '40'
                    || item.value == '50' || item.value == '60' || item.value == '70') {
                    arr.splice(j--, 1)
                  }
                }
              }
              that.relationList = arr
            }
          }
        })
      },
      checkIdcard () {  //验证身份证是否合法并判断证件上传类型
        let that = this
        let azcp0001 = that.dataSs17002.azcp0001
        if (azcp0001 != '' && typeof (azcp0001) != 'undefined') {
          azcp0001 = azcp0001.toUpperCase()
          that.dataSs17002.azcp0001 = azcp0001

          if (!IdentityCodeValid(azcp0001)) {
            that.$Message.error('申请人身份证号码格式不合法')
            that.dataSs17002.azcp0001 = null
          } else {
            let age = getAgeByIdcardByHD(azcp0001, new Date())
            if (age > 18) {
              that.householdRegisterState = true
              that.householdRegisterVisible = false
              that.identityCardVisible = true
            } else {
              that.householdRegisterState = false
            }
          }
        }
      },
      checkData () { //事前查验
        //已发送核对或详情状态不触发事件
        if (this.isSendedHd || this.readonly) {
          return
        }
        let that = this
        let fieldsToValidate = ['azcp0001', 'azcp0003']
        let validate = true
        let err_msg = []
        for (let item of fieldsToValidate) {
          that.$refs['dataSs17002'].validateField(item, (error) => {
            if (error) {
              validate = false
              err_msg.push(error)
            }
          })
        }
        if (validate) {
          that.yzModalTitle = '事前查验-姓名：【' + that.dataSs17002.azcp0003 + '】 身份证号码：【' + that.dataSs17002.azcp0001 + '】'
          that.ss00011ModelShow = true
        } else {
          that.$Message.error(err_msg[0])
          return
        }
      },
      //回显查验状态
      setCheckStatus (azcp0578) {
        let that = this
        if (azcp0578 == '1') {
          that.checkBtnName = '已查验'
          that.validateStatus = false
        } else {
          that.checkBtnName = '未查验'
          that.validateStatus = true
        }
      },
      showPoorRule () {
        this.$refs.poorRuleModal.ruleShow = true
      },
      showSingleRule () {
        this.$refs.singleRuleModal.ruleShow = true
      },
      // 户籍区划功能,
      shengShiQuHua (localOrNot) {
        if (localOrNot == undefined || localOrNot == '') {
          this.hujiquhuaDisabled = true
          this.dataSs17002.azcp0602 = null
          this.dataSs17002.azcp0603 = null
        } else if (localOrNot == '1') { //本地户籍的, 区划 not editable
          this.hujiquhuaDisabled = true
          this.dataSs17002.azcp0602 = '210000000000'
          this.dataSs17002.azcp0603 = '210100000000'
          if (this.dataSs17002.azcp0504 === '67') {
            this.multipleDisabilities = true
            this.multipleDisabilitiesEdit = true
          } else {
            this.multipleDisabilities = false
            this.multipleDisabilitiesEdit = false
          }
        } else if (localOrNot == '0') { //外地户籍的, 区划 editable
          this.hujiquhuaDisabled = false
          if (this.dataSs17002.azcp0504 === '67') {
            this.multipleDisabilities = true
            this.multipleDisabilitiesEdit = false
          } else {
            this.multipleDisabilities = false
          }
        }
      },
      loadImg (response, file, name, id) {
        if (response.errcode == 0) {
          this.$set(this.dataSs17002, name, response.data)
        } else {
          this.$Message.error('上传失败！')
        }
        this.Loading = false
      },
    },
    watch: {
      'dataSs17002.azcp0001': {
        handler (newName, oldName) {
          if (oldName != undefined && oldName != '' && newName != oldName) {
            this.checkBtnName = '未查验'
            this.validateStatus = true
          }
        },
        immediate: true,
      },
      'dataSs17002.azcp0003': {
        handler (newName, oldName) {
          if (oldName != undefined && oldName != '' && newName != oldName) {
            this.checkBtnName = '未查验'
            this.validateStatus = true
          }
        },
        immediate: true,
        // deep: true
      },
      validateStatus (newVal, oldVal) {
        if (!newVal) {
          this.checkBtnName = '已查验'
          this.dataSs17002.azcp0578 = '1' //事前校验通过
        } else {
          this.checkBtnName = '未查验'
        }
      },
      // 户籍验证功能 人员信息验证后, 根据是否本地户籍结果更改户籍区划选项编辑状态
      'dataSs17002.azcp0591': {
        handler (newName, oldName) {
          if (newName != oldName) {
            this.shengShiQuHua(newName)
          }
          //本市户籍的,不允许更改是否残疾
          if (newName == '1') {
            this.azcp0503Disabled = true
            this.disabledCjr = true
          } else {
            this.azcp0503Disabled = false
            this.disabledCjr = false
          }
        },
        immediate: true,
      },
      //监控残疾类别
      // 1、查验本市户籍，是否残疾、残疾等级、残疾类别锁定状态不可能更改。如果残疾类别是多重，显示6个残疾子类型字段，子类型字段为锁定状态不能更改；如果残疾类别不是多重，不显示子类型
      // 2、查验非本市户籍，是否残疾、残疾等级、残疾类别状态可选。如果残疾类别是多重，显示6个残疾子类型字段，子类型字段至少选择两个；如果残疾类别不是多重，不显示子类型
      'dataSs17002.azcp0504': {
        handler (newName, oldName) {
          if (newName == '67') {
            this.multipleDisabilities = true
            if (this.dataSs17002.azcp0591 == '1') {
              this.multipleDisabilitiesEdit = true
            } else {
              this.multipleDisabilitiesEdit = false
            }
          } else {
            this.multipleDisabilities = false
          }
        },
        immediate: true,
      },
      //先为残疾,验证为非残疾后, 残疾类别等级应为不可选
      'dataSs17002.azcp0503': {
        handler (newName, oldName) {
          this.setDisabilityState01()
        },
        immediate: true,
      },
    }
  }
</script>

<style scoped>
    /deep/ .ivu-form-item-error-tip {
        display: none;
    }

    .ivu-form-item {
        margin-bottom: 0px;
    }

    .itemStyle {
        width: 180px
    }

    .head-img1 {
        height: 200px;
        width: 343px;
        margin-top: 15px;
    }

    .imgBackColor {
        height: 250px;
    }

    .positiveTDiv {
        height: 250px;
        background-color: #7CCD7C;
        color: white;
        font-size: 17px;
        font-weight: 700;
        word-wrap: break-word; /*英文的时候需要加上这句，自动换行*/
        writing-mode: vertical-rl; /*从左向右 从右向左是 writing-mode: vertical-rl;*/
        writing-mode: tb-rl; /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl；*/
        text-align: center;
        padding: 0px;
        display: flex;
        -webkit-display: flex;
        flex-direction: column;
        justify-content: center;
        letter-spacing: 20px;
        border-radius: 3px;
    }

    .idCard {
        height: 100%;
        padding: 20px;
        background-color: WhiteSmoke;
    }

    .headerBtnDiv {
        height: 160px;
        width: 120px;
        float: right;
        margin-right: 80px;
        margin-bottom: 15px;
        background: #5CACEE;
        border-radius: 3px;
        color: white;
        text-align: center;
        line-height: 160px;
        font-weight: 600;
        font-size: 20px;
    }
</style>
